//
//  EMyTeacherViewController.m
//  WheatPlan
//
//  Created by 王晨辉 on 15/6/4.
//  Copyright (c) 2015年 IOSTeam. All rights reserved.
//

#import "EMyTeacherViewController.h"
#import "CommonMacro.h"
#import "MySideView.h"
#import "TestQuestionsReportViewController.h"

@interface EMyTeacherViewController ()<UITableViewDelegate,UITableViewDataSource>
{
    UIBarButtonItem *rightBtn;
    BOOL ifshowSide;
    MySideView *sideView;
    UIButton *RegistBtn;
    
}

@property(nonatomic,copy)NSMutableArray *nameArray;
@property(nonatomic,copy)NSMutableArray *typeArray;
@property(nonatomic,copy)NSMutableArray *chooseArray;
@property(nonatomic,copy)NSString *typeName;
@property(nonatomic,copy)UITableView *myTable;


@end

@implementation EMyTeacherViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initSubViews];
    
    
    
    
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *ID = [user objectForKey:@"ID"];
    
    NSDictionary *param5 = @{@"userId": ID,@"typeId":self.typeID,@"timeType":@"4"};
    
    [UserDAL getParentReportParams:param5 withBlock:^(NSArray *data, NSError *error) {
        if (data) {
            
            ////NSLog(@"data的数据为%@",data);
            
            
            nameArray = [NSMutableArray array];
            timeArray = [NSMutableArray array];
            taskIdArray = [NSMutableArray array];

            if (data.count!=0) {
            for (NSDictionary * myDic in data) {
                [nameArray addObject:myDic[@"taskResult"]];
                [timeArray addObject:myDic[@"taskTime"]];
                [taskIdArray addObject:myDic[@"taskId"]];

            }
            }else{
                
                [MBProgressHUD hideHUDForView:_myTable animated:YES];

                alert(@"请先做成长测评，稍后出测评报告 ");
                
                
            }
            [_myTable reloadData];
            
            
        }else
        {
            
        }
    }];

    
    
    _nameArray = [NSMutableArray arrayWithObjects:@"语文语文语文",@"数学数学数学",@"英语英语英语",@"政治政治政治",@"狗屎狗屎狗屎狗屎", nil];
    _typeArray = [NSMutableArray arrayWithObjects:@"早教上门",@"未付钱",@"未付钱",@"上课中",@"已结束", nil];
    _chooseArray = [NSMutableArray arrayWithObjects:@"全部",@"早教上门",@"未付钱",@"上课中",@"已结束", nil];
    
    self.view.backgroundColor = [UIColor yellowColor];
    ifshowSide = NO;
    sideView = [[MySideView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/5,64, SCREEN_WIDTH/5*4, SCREEN_HEIGHT)];
//    sideView = [[MySideView alloc]initWithFrame:CGRectMake(0,NavbarHight, SCREEN_WIDTH, SCREEN_HEIGHT)];
    sideView.alpha = 1;
    sideView.backgroundColor = [UIColor whiteColor];
    
    UIImageView * image = [[UIImageView alloc]initWithFrame:CGRectMake(-SCREEN_WIDTH/5,0, SCREEN_WIDTH/5, SCREEN_HEIGHT)];
    image.alpha = 0.5;
    image.backgroundColor = [UIColor grayColor];
//    image.userInteractionEnabled = NO;
    [sideView addSubview:image];
    
    
    
    [self subView];
    
    
    
    sideView.myifshowBlock = ^(BOOL ifshow){
        ifshowSide = ifshow;
    };
    
    
    //设置导航栏头文字
    self.navigationItem.title = self.name;
    //设置导航栏背景颜色
    [self.navigationController.navigationBar setBarTintColor:[GetFileModel colorWithHexString:@"#44afd7" alpha:1]];
    //设置导航栏字体颜色
    [self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    //自定义左右按钮
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setBackgroundImage:[UIImage imageNamed:@"_0000_返回.png"]
                      forState:UIControlStateNormal];
    [button addTarget:self action:@selector(turntolast)
     forControlEvents:UIControlEventTouchUpInside];
    button.frame = CGRectMake(0, 0, 20, 15);
    
    UIBarButtonItem *menuButton = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    self.navigationItem.leftBarButtonItem = menuButton;
    
    
    // Do any additional setup after loading the view.
}
-(void)turntolast{
    
    [self dismissViewControllerAnimated:YES completion:nil];
}

-(void)subView{
    
    UILabel * timeLab = [[UILabel alloc]initWithFrame:CGRectMake(20, ((SCREEN_HEIGHT)/6-60)/2, 200, 30)];
    timeLab.text = @"评测时间:";
    timeLab.font = [UIFont systemFontOfSize:14];
    timeLab.textAlignment = NSTextAlignmentLeft;
    timeLab.numberOfLines = 2;
    [sideView addSubview:timeLab];
    
    UIButton * weekBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [weekBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [weekBtn setBackgroundImage:[UIImage imageNamed:@"一周内@2x.png.png"] forState:UIControlStateNormal];
    weekBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    weekBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
    [weekBtn addTarget:self action:@selector(weekBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    weekBtn.frame = CGRectMake(20, ((SCREEN_HEIGHT)/6-60)/2+50, 100, 30);
    [sideView addSubview:weekBtn];
    
    
    UIButton * JanuaryBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [JanuaryBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [JanuaryBtn setBackgroundImage:[UIImage imageNamed:@"一个月内@2x.png.png"] forState:UIControlStateNormal];
    JanuaryBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    JanuaryBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
    [JanuaryBtn addTarget:self action:@selector(JanuaryBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    JanuaryBtn.frame = CGRectMake(140, ((SCREEN_HEIGHT)/6-60)/2+50, 100, 30);
    [sideView addSubview:JanuaryBtn];
    
    UIButton * marchBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [marchBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [marchBtn setBackgroundImage:[UIImage imageNamed:@"三个月内@2x.png.png"] forState:UIControlStateNormal];
    marchBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    marchBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
    [marchBtn addTarget:self action:@selector(marchBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    marchBtn.frame = CGRectMake(20, ((SCREEN_HEIGHT)/6-60)/2+100, 100, 30);
    [sideView addSubview:marchBtn];
    
    UIButton * marchwellBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [marchwellBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [marchwellBtn setBackgroundImage:[UIImage imageNamed:@"三个月以前@2x.png.png"] forState:UIControlStateNormal];
    marchwellBtn.titleLabel.font = [UIFont systemFontOfSize:14];
    marchwellBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
    [marchwellBtn addTarget:self action:@selector(marchwellBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    marchwellBtn.frame = CGRectMake(140, ((SCREEN_HEIGHT)/6-60)/2+100, 100, 30);
    [sideView addSubview:marchwellBtn];
    
    
    
    
    
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex

{
    
    
    NSString *msg = [[NSString alloc] initWithFormat:@"您点击的是第%d个按钮!",buttonIndex];
    ////NSLog(@"msg:%@",msg);
    if (buttonIndex == 0) {
        
        [self dismissViewControllerAnimated:YES completion:nil];
        ////NSLog(@"1111111");
        
    }else if(buttonIndex == 1){
        
        
        ////NSLog(@"2222222");
        
        
    }
    
    
}



-(void)weekBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *ID = [user objectForKey:@"ID"];
    
    NSDictionary *param5 = @{@"userId": ID,@"typeId":self.typeID,@"timeType":@"0"};
    
    [UserDAL getParentReportParams:param5 withBlock:^(NSArray *data, NSError *error) {
        if (data) {
            
            ////NSLog(@"data的数据为%@",data);
            
            //             ////NSLog(@"myQuArry==================%@",myQuArry);
            
            nameArray = [NSMutableArray array];
            timeArray = [NSMutableArray array];
            
            if (data.count!=0) {
                for (NSDictionary * myDic in data) {
                    [nameArray addObject:myDic[@"taskResult"]];
                    [timeArray addObject:myDic[@"taskTime"]];
                    
                }
            }else{
                
                [MBProgressHUD hideHUDForView:_myTable animated:YES];
                
                [JKAlert showMessage:@"提示" message:@"暂无可选择事项"];
                
            }
            [_myTable reloadData];
            
            
        }else
        {
            
        }
    }];

    
    [RegistBtn setTitle:@"一周内" forState:UIControlStateNormal];
    
    
    
    
    
}
-(void)JanuaryBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *ID = [user objectForKey:@"ID"];
    
    NSDictionary *param5 = @{@"userId": ID,@"typeId":self.typeID,@"timeType":@"1"};
    
    [UserDAL getParentReportParams:param5 withBlock:^(NSArray *data, NSError *error) {
        if (data) {
            
            ////NSLog(@"data的数据为%@",data);
            
            //             ////NSLog(@"myQuArry==================%@",myQuArry);
            
            nameArray = [NSMutableArray array];
            timeArray = [NSMutableArray array];
            
            if (data.count!=0) {
                for (NSDictionary * myDic in data) {
                    [nameArray addObject:myDic[@"taskResult"]];
                    [timeArray addObject:myDic[@"taskTime"]];
                    
                }
            }else{
                
                [MBProgressHUD hideHUDForView:_myTable animated:YES];
                
                [JKAlert showMessage:@"提示" message:@"暂无可选择事项"];
                
            }
            [_myTable reloadData];
            
            
        }else
        {
            
        }
    }];

    [RegistBtn setTitle:@"一个月内" forState:UIControlStateNormal];
    
    
    
    
}
-(void)marchBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *ID = [user objectForKey:@"ID"];
    
    NSDictionary *param5 = @{@"userId": ID,@"typeId":self.typeID,@"timeType":@"2"};
    
    [UserDAL getParentReportParams:param5 withBlock:^(NSArray *data, NSError *error) {
        if (data) {
            
            ////NSLog(@"data的数据为%@",data);
            
            //             ////NSLog(@"myQuArry==================%@",myQuArry);
            
            nameArray = [NSMutableArray array];
            timeArray = [NSMutableArray array];
            
            if (data.count!=0) {
                for (NSDictionary * myDic in data) {
                    [nameArray addObject:myDic[@"taskResult"]];
                    [timeArray addObject:myDic[@"taskTime"]];
                    
                }
            }else{
                
                [MBProgressHUD hideHUDForView:_myTable animated:YES];
                
                [JKAlert showMessage:@"提示" message:@"暂无可选择事项"];
                
            }
            [_myTable reloadData];
            
            
        }else
        {
            
        }
    }];

    [RegistBtn setTitle:@"三个月内" forState:UIControlStateNormal];
    
    
    
    
}
-(void)marchwellBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    NSUserDefaults *user = [NSUserDefaults standardUserDefaults];
    NSString *ID = [user objectForKey:@"ID"];
    
    NSDictionary *param5 = @{@"userId": ID,@"typeId":self.typeID,@"timeType":@"3"};
    
    [UserDAL getParentReportParams:param5 withBlock:^(NSArray *data, NSError *error) {
        if (data) {
            
            ////NSLog(@"data的数据为%@",data);
            
            //             ////NSLog(@"myQuArry==================%@",myQuArry);
            
            nameArray = [NSMutableArray array];
            timeArray = [NSMutableArray array];
            
            if (data.count!=0) {
                for (NSDictionary * myDic in data) {
                    [nameArray addObject:myDic[@"taskResult"]];
                    [timeArray addObject:myDic[@"taskTime"]];
                    
                }
            }else{
                
                [MBProgressHUD hideHUDForView:_myTable animated:YES];
                
                [JKAlert showMessage:@"提示" message:@"暂无可选择事项"];
                
            }
            [_myTable reloadData];
            
            
        }else
        {
            
        }
    }];

    [RegistBtn setTitle:@"三个月以前" forState:UIControlStateNormal];
    
    
    
    
}
-(void)vgoodBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    [RegistBtn setTitle:@"很好" forState:UIControlStateNormal];
    
    
    
    
}
-(void)goodBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    [RegistBtn setTitle:@"良好" forState:UIControlStateNormal];
    
    
    
    
}
-(void)strengthenBtnClick:(UIButton *)mySwitch{
    
    
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    
    [RegistBtn setTitle:@"待加强" forState:UIControlStateNormal];
    
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)turntoChoose:(UIButton *)mySwitch

{
    for (int i; i==0; i++) {
        if (i==0) {
            ifshowSide = YES;
        }else{
            mySwitch.selected = !mySwitch.selected;;
        }
    }
    
    mySwitch.selected = ifshowSide;
    ifshowSide = !mySwitch.selected;
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.2];
    [animation setType:kCATransitionPush];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [self.view addSubview:sideView];
    
    if (ifshowSide==NO) {
        [animation setSubtype:kCATransitionFromRight];
        sideView.hidden = NO;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    if (ifshowSide==YES) {
        [animation setSubtype:kCATransitionFromLeft];
        sideView.hidden = YES;
        [[sideView layer] addAnimation:animation forKey:@"switch"];
    }
    
    sideView.mysideblock = ^(NSString *myStr){
        _typeName = myStr;
        ////NSLog(@"myType是什么%@",_typeName);
        [RegistBtn setTitle:[NSString stringWithFormat:@"%@",_typeName] forState:UIControlStateNormal];
    };
}

-(void)initSubViews
{
    
    RegistBtn = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-95, 6,90, 30)];
    [RegistBtn setTitle:@"全部" forState:UIControlStateNormal];
    [RegistBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [RegistBtn addTarget:self action:@selector(turntoChoose:) forControlEvents:UIControlEventTouchUpInside];
    RegistBtn.titleLabel.font = [UIFont systemFontOfSize: 15.0];
//    RegistBtn.backgroundColor = UIColorWithRGBA(219, 99, 101, 1);
    //    [RegistBtn setBackgroundColor:[UIColor clearColor]];
    [self.navigationController.navigationBar addSubview:RegistBtn];
    
    
//    int a =  self.navigationController.navigationBar.frame.size.height+20;
    
    _myTable = [[UITableView alloc]initWithFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
    _myTable.delegate = self;
    _myTable.dataSource = self;
    _myTable.rowHeight = 52;
    [MBProgressHUD showHUDAddedTo:_myTable animated:YES];
    [self.view addSubview:_myTable];
    
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return nameArray.count;
}


#pragma mark--- tableViewDelegate 区尾的高度

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    
    return 40;
    
}
#pragma mark--- tableViewDelegate cell

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    [MBProgressHUD hideHUDForView:_myTable animated:YES];
    static NSString *NOTIFY = @"cell";
    UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:NOTIFY];
    if (cell==nil) {
        //
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NOTIFY];
        //        cell.textLabel.text = _nameArray[indexPath.row];
        //        cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
        //        UILabel *typeLable = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-150, ((SCREEN_HEIGHT-a)/6-30)/2, 80, 30)];
        //        [cell addSubview:typeLable];
        //        typeLable.text = _typeArray[indexPath.row];
        
        _myTable.separatorStyle = UITableViewCellEditingStyleNone;
        
        UIView * view = [[UIView alloc]initWithFrame:CGRectMake(0, _myTable.rowHeight-1, SCREEN_WIDTH, 1)];
        view.backgroundColor = UIColorWithRGBA(229, 229, 231, 1);
        [cell addSubview:view];
        
//        NSMutableArray * imageName = [[NSMutableArray alloc]initWithObjects:@"很好@2x.png.png",@"良好@2x.png.png",@"待加强@2x.png.png",@"良好@2x.png.png",@"待加强@2x.png.png",nil];
//        
//        UIImageView * image = [[UIImageView alloc]initWithFrame:CGRectMake(9, 15/2, 37, 37)];
//        image.image = [UIImage imageNamed:[imageName objectAtIndex:indexPath.row]];
//        [cell addSubview:image];
        
        UILabel * timeLab = [[UILabel alloc]initWithFrame:CGRectMake(5, 0, SCREEN_WIDTH-5, 52/2)];
        timeLab.text = [NSString stringWithFormat:@"评测时间：%@",timeArray[indexPath.row]];
        timeLab.font = [UIFont systemFontOfSize:12];
        timeLab.textAlignment = NSTextAlignmentLeft;
        timeLab.numberOfLines = 2;
        [cell addSubview:timeLab];
        
        UILabel * ParentLab = [[UILabel alloc]initWithFrame:CGRectMake(5, 52/2, SCREEN_WIDTH-5, 52/2)];
        ParentLab.text = [NSString stringWithFormat:@"评测结果：%@",nameArray[indexPath.row]];
        ParentLab.font = [UIFont systemFontOfSize:12];
        ParentLab.textAlignment = NSTextAlignmentLeft;
        ParentLab.numberOfLines = 2;
        [cell addSubview:ParentLab];
        
        
        
        
        
//        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

        
        
    }
    
    
    return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    
    TestQuestionsReportViewController * testQVC = [[TestQuestionsReportViewController alloc]init];
    testQVC.taskId = [NSString stringWithFormat:@"%@",taskIdArray[indexPath.row]];
    testQVC.picType = self.typeID;//==2 有柱状图
    UINavigationController * nav = [[UINavigationController alloc]initWithRootViewController:testQVC];
    [self presentViewController:nav animated:YES completion:nil];

    
    
    
    
    
    
    
}




@end
